var page = sm("do_Page");
var app = sm("do_App");
var nf = sm("do_Notification");
var root = ui("$");
//ui
var do_ALayout_Phone = ui("do_ALayout_Phone");
var qqHttp = require("helper/http");
var communityUrl = require("url/community");
//创建一个External对象
var external = sm("do_External");
var httpUrl = communityUrl.url.yellow.detail;
//andriod返回键
page.on("back", function() {
  app.closePage();
});

var headerAout = ui("headerAout");
var addheader = headerAout.add("header", "source://view/reuse/header.ui", 0, 0);
//左上角-返回
var headerLeft = ui(addheader+".headerLeft");
headerLeft.on("touch", function() {
  app.closePage()
});

var labelTitle = ui(addheader+".labelTitle");
labelTitle.text = "社区黄页";

var yellowId;
page.on("loaded", function() {
	yellowId=page.getData().yellowId;
	loadPage();
});

var do_Labelmoney_Name=ui("do_Labelmoney_Name");
var do_Label_Address=ui("do_Label_Address");
var do_Label_Phone=ui("do_Label_Phone");
function loadPage(){
	qqHttp.post(httpUrl, {"id":yellowId}, function(data) {
		if(null!=data.detail){
			do_Labelmoney_Name.text=data.detail.name;
			do_Label_Address.text=data.detail.address;
			do_Label_Phone.text=data.detail.phone;
		}
	})
}

do_ALayout_Phone.on("touch", function() {
	external.openDial(do_Label_Phone.text);
})
